﻿function GetChangeByDropDownExpCVUpdate(expDropDown) {

    window.scrollTo(0, 0);
    $("body").ajaxLoader();

    var selectedUpdateTime = $('#ctl00_SearchContainer_ddlCvUpdate option:selected').text().trim();
    var selectedExperience = $('#ctl00_SearchContainer_DropDownListExperience option:selected').text().trim();

    var jobTitleText = "";
    $("#JobTitleSearch :text").each(function () {
        jobTitleText += $(this).val() + "$";
    });

    var jobSeekerPlaceText = "";
    $("#Place :text").each(function () {
        jobSeekerPlaceText += $(this).val() + "$";
    });

    var jobCategoryText = "";
    $("#Category :text").each(function () {
        jobCategoryText += $(this).val() + "$";
    });


    var jobSeekerEmploymentType = "";
    $("#EmploymentType :text").each(function () {
        jobSeekerEmploymentType += $(this).val() + "$";
    });


    var jobSeekerQualification = "";
    $("#Qualification :text").each(function () {
        jobSeekerQualification += $(this).val() + "$";
    });

    var jobSeekerSkills = "";
    $("#Skills :text").each(function () {
        jobSeekerSkills += $(this).val() + "$";
    });


    var pageSize = $('#ctl00_MainContent_ddlPageSize option:selected').val().trim();
    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "SearchCV.aspx/getDataByExperienceCVCUpdate",
        data: JSON.stringify({ 'pageSize': pageSize, 'pageIndex': '0', 'updateTime': selectedUpdateTime, 'experience': selectedExperience, 'jobTitle': jobTitleText, 'location': jobSeekerPlaceText, 'category': jobCategoryText, 'employmentType': jobSeekerEmploymentType, 'qualification': jobSeekerQualification, 'skills': jobSeekerSkills }),
        datatype: "json",
        success: function (data) {
            //alert('PrintGrid1');

            PrintGrid(data, 1);
            $("body").ajaxLoaderRemove().delay(3000);
        },
        error: function (xhr, tStatus, err) {
            $("body").ajaxLoaderRemove().delay(3000);
            if (xhr.status == "401") {
                alert(xhr.status + " User Authorisation failed.Please login again.");
                location.reload();
            }
        },
        complete: function (xhr, status) {
            var msg = xhr.responseText;
        }
    })
    return false;
}